﻿using System.Web;
using System.Web.UI;
using Besture.Common.Definition;
using Besture.Model;

namespace Besture.Common
{
    public class BaseClientPage : Page
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        protected int UserId
        {
            get { return HttpContext.Current.Session[Constants.SESSION_KEY_LOGIN_USER] == null ? 0 : ((UserModel)HttpContext.Current.Session[Constants.SESSION_KEY_LOGIN_USER]).ID; }
        }

        /// <summary>
        /// 用户信息
        /// </summary>
        protected UserModel LoginUserInfo
        {
            get { return HttpContext.Current.Session[Constants.SESSION_KEY_LOGIN_USER] == null ? null : (UserModel)HttpContext.Current.Session[Constants.SESSION_KEY_LOGIN_USER]; }
        }

        /// <summary>
        /// 用户Id
        /// </summary>
        protected int WXUserId
        {
            get { return HttpContext.Current.Session[Constants.SESSION_KEY_WXLOGIN_USER] == null ? 0 : ((UserModel)HttpContext.Current.Session[Constants.SESSION_KEY_WXLOGIN_USER]).ID; }
        }

        /// <summary>
        /// 用户信息
        /// </summary>
        protected UserModel WXLoginUserInfo
        {
            get { return HttpContext.Current.Session[Constants.SESSION_KEY_WXLOGIN_USER] == null ? null : (UserModel)HttpContext.Current.Session[Constants.SESSION_KEY_WXLOGIN_USER]; }
        }


    }
}